/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control_acceso.comun;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author edu_luis
 */
public class Persona {
    int id;
    String Nombre;
    String Apellido;
    ArrayList<Banco>banco;
    String username;
    String password;
    String cedula;

    public boolean verificarUsuario(String u, String c) throws FileNotFoundException {
        boolean valido = false;
        File archivo = new File("/home/edu_luis/NetBeansProjects/acceso.txt");
        Scanner s = new Scanner(archivo);
         
        while (s.hasNext()) {
            String linea = s.nextLine();
            System.out.println(linea);
            StringTokenizer st = new StringTokenizer(linea, ";");
            while (st.hasMoreTokens()) {
                //Nombre = st.nextToken().trim();
                username = st.nextToken().trim();
                password = st.nextToken().trim();
              //  Nombre = st.nextToken().trim();
            }
            if (u.equalsIgnoreCase(username) && c.equalsIgnoreCase(password)) {
                valido = true;
                break;
            }

        }
        return valido;
    }
    
    
    
    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }

    public String getNombre() {
        return Nombre;
    }

    public void setNombre(String Nombre) {
        this.Nombre = Nombre;
    }

    public String getApellido() {
        return Apellido;
    }

    public void setApellido(String Apellido) {
        this.Apellido = Apellido;
    }

    public ArrayList<Banco> getBanco() {
        return banco;
    }

    public void setBanco(ArrayList<Banco> banco) {
        this.banco = banco;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
}
